@model Nebulosa.Models.DatabaseConfigModel

@{
	Layout = "_Layout.cshtml";
	ViewBag.Title = "Configure database";
	string database = ViewBag.database;
	
	bool showServer = (database != "sqlite" && database != "nebulosadb");
	bool showDatabase = (database != "nebulosadb");
	bool showIntegratedSecurity = (database == "sqlserver");
	bool showDatabaseUser = (database == "sqlserver" || database == "azuresql");
	bool showDatabasePassword = (database == "sqlserver" || database == "azuresql");
}
<form id="database-selection-form" method="post" action="@Url.Action("DatabaseConfig")" class="form-horizontal">
	<fieldset>
		<legend>@Nebulosa.Globalization.Install.Translate.LayoutTitle - Configure database</legend>
		<div class="row-fluid"><div class="span12">Configure database connection:</div></div>
		<div class="control-group @if(!showServer){<text>hide</text>}">
			<label class="control-label" for="inputEmail">Server:</label>
			<div class="controls">
				@Html.TextBoxFor(model => model.DatabaseServer, new { @placeholder = Nebulosa.Globalization.Install.Translate.DatabaseServer })
			</div>
		</div>
		<div class="control-group @if(!showDatabase){<text>hide</text>}">
			<label class="control-label" for="inputEmail">Database name:</label>
			<div class="controls">
				@Html.TextBoxFor(model => model.DatabaseName, new { @placeholder = Nebulosa.Globalization.Install.Translate.DatabaseName })
			</div>
		</div>
		<div class="control-group @if(!showIntegratedSecurity){<text>hide</text>}">
			<label class="control-label" for="inputEmail">Windows security:</label>
			<div class="controls">
				@Html.CheckBox("IntegratedSecurity", Model.IntegratedSecurity)
			</div>
		</div>
		<div class="control-group @if(!showDatabaseUser){<text>hide</text>}">
			<label class="control-label" for="inputEmail">User:</label>
			<div class="controls">
				@Html.TextBoxFor(model => model.DatabaseUser, new { @placeholder = Nebulosa.Globalization.Install.Translate.DatabaseUser })
			</div>
		</div>
		<div class="control-group @if(!showDatabasePassword){<text>hide</text>}">
			<label class="control-label" for="inputEmail">Password:</label>
			<div class="controls">
				@Html.PasswordFor(model => model.DatabasePassword, new { @placeholder = Nebulosa.Globalization.Install.Translate.DatabasePassword })
			</div>
		</div>
		<div class="form-actions">
			@Html.HiddenFor(model => model.DatabaseType)
			<button type="submit" class="btn btn-primary">@Nebulosa.Globalization.Install.Translate.SaveAndContinue</button>
		</div>
	</fieldset>
</form>